

module.exports = {

    mode: 'history',
    base: __dirname,
    routes: [
        //
        // { path: '/user/:id',
        //     components:{
        //         default: require('./component/header.vue'),
        //        b: require('./views/index.vue'),
        //     },
        //     children: [
        //         {
        //             // 当 /user/:id/profile 匹配成功，
        //             // UserProfile 会被渲染在 User 的 <router-view> 中
        //             path: 'hello',
        //             component: require('./views/hello.vue')
        //         },
        //         {
        //             // 当 /user/:id/posts 匹配成功
        //             // UserPosts 会被渲染在 User 的 <router-view> 中
        //             path: 'about',
        //             component: require('./views/about.vue')
        //         }
        //     ]
        // },

        {
            path: '/',
            // a single route can define multiple named components
            // which will be rendered into <router-view>s with corresponding names.
            components: {
                default: require('./component/header.vue'),
                //a: require('./views/about.vue'),
                b: require('./views/about.vue'),
            }
        },
        { path: '/lolga/:id',
            // a single route can define multiple named components
            // which will be rendered into <router-view>s with corresponding names.
            components: {
                default: require('./component/header.vue'),
                //a: require('./views/about.vue'),
                b: require('./views/about.vue'),
            },
            children: [,
                { path: '',
                    components: {
                        default: require('./component/header.vue'),
                        //a: require('./views/about.vue'),
                        b: require('./views/about.vue'),
                    }
                },
                {
                    path: 'game',
                    component: require('./views/game.vue'),

                },
                {
                    path: 'server',
                    component: require('./views/server.vue'),
                }
            ]
        },
        {
            path: '/sell',
            components: {
                default: require('./component/header.vue'),
                //a: require('./views/about.vue'),
                b: require('./views/hello.vue')
            }
        },
        {path: '/index',
            component: {
                default: require('./component/header.vue'),
                a: require('./views/about.vue'),
                b: require('./views/index.vue'),
            }
        },
        // {path: '/about', component: require('./views/about.vue'),name:"about"},
        // {path: '/hello',component: require('./views/hello.vue'),name:"HELLO"},
        // {path: '/index/:id', component: require('./views/index.vue')},




        //server
        // { path: 'index/:id',
        //     components: {
        //             default: require('./component/header.vue'),
        //             //a: require('./views/about.vue'),
        //             b: require('./views/about.vue'),
        //         },
        //     children: [
        //         {
        //             path: 'game',
        //             component: require('./views/game.vue'),
        //
        //         },
        //         {
        //             path: 'server',
        //             component: require('./views/server.vue'),
        //
        //
        //         }
        //     ]
        // }

    ],

    scrollBehavior (to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition;

        } else {
            return { x: 0, y:0 }
        }
    }
};




